import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; 
class ButtonPage extends StatelessWidget {
  const ButtonPage({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('ButtonPage'),
      ),
      floatingActionButton: Container(
        width: 80,
        height: 80,
        padding: EdgeInsets.all(8),
        margin: EdgeInsets.only(top: 1),
        decoration:BoxDecoration(
          borderRadius: BorderRadius.circular(40),
          color: Colors.white
        ),
        child: FloatingActionButton(  //浮动按钮
          child: Icon(Icons.add,size: 40,),
          onPressed: (){},
        ),
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,//浮动位置
      bottomNavigationBar: BottomNavigationBar(
        iconSize: 30.0,
        type: BottomNavigationBarType.fixed, //设置可以放多个如果不设置最多只能放3个
        items: [
          BottomNavigationBarItem(
            icon: Icon(Icons.home),
            title:Text("home")
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.image),
            title:Text("image")
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.inbox),
            title:Text("add")
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.https),
            title:Text("https")
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.http),
            title:Text("http")
          ),
        ],
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        children: <Widget>[
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
                RaisedButton(
                  child: Text("button"),
                  color: Colors.blue,
                  textColor: Colors.white,
                  elevation: 20,  //阴影
                  onPressed: (){}
                ),
                SizedBox(width: 10,),
                Container(
                  width: 100,
                  height: 50,
                  child: RaisedButton(
                    child: Text("自定宽高"),
                    color: Colors.blue,
                    textColor: Colors.white,
                    onPressed: (){}
                  ),
                ),
                SizedBox(width: 10,),
                RaisedButton.icon(
                  label: Text("icon"),
                  color: Colors.blue,
                  textColor: Colors.white, 
                  icon: Icon(Icons.home),
                  onPressed: (){}
                ),
                SizedBox(width: 10,), 
                
            ],
          ),
          SizedBox(height: 10,),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
            RaisedButton(
              child: Text("button"),
              color: Colors.blue,
              textColor: Colors.white,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(50)
              ),
              onPressed: (){}
            ),
            Container(
              width: 100,
              height: 100,
              child: RaisedButton(
                  child: Text("button"),
                  color: Colors.blue,
                  textColor: Colors.white,
                  splashColor: Colors.green,
                  shape: CircleBorder(
                      side: BorderSide(
                        color: Colors.white
                      )
                  ),
                  onPressed: (){}
               ),
            ),
            FlatButton(
              child: Text("扁平按钮"),
              color: Colors.blue,
              textColor: Colors.white,
              onPressed: (){}
            ),
            OutlineButton(
              child: Text("没背景"),
              textColor: Colors.blue,
              onPressed: (){}
            )
          ],),
          SizedBox(height: 10,),
          Row( 
            children: <Widget>[
              Expanded(
              child: Container(
              margin: EdgeInsets.all(20),
              width: 100,
              height: 50,
              child: RaisedButton(
                  child: Text("自定宽高"),
                  color: Colors.blue,
                  textColor: Colors.white,
                  onPressed: (){}
                ),
              ),
              )
            ],
          ),
          Row( 
            children: <Widget>[
              ButtonBar(
                children: <Widget>[
                  RaisedButton(
                    child: Text("ButtonBar"),
                    color: Colors.blue,
                    textColor: Colors.white,
                    elevation: 20,  //阴影
                    onPressed: (){}
                  ),
                  RaisedButton(
                    child: Text("ButtonBar"),
                    color: Colors.blue,
                    textColor: Colors.white,
                    elevation: 20,  //阴影
                    onPressed: (){}
                  )
                ],
              )
            ],
          )
          
        ],
      ),
    );
  }
}